import Index from "../pages/Index.vue";
import Team from "../pages/team/Team.vue";
import Person from "../pages/user/PersonPage.vue";
import * as VueRouter from 'vue-router'
import SearchPage from "../pages/SearchPage.vue";
import PersonInfo from "../pages/user/PersonInfoPage.vue";
import PersonEditPage from "../pages/user/PersonEditPage.vue";
import SearchResultPage from "../pages/SearchResultPage.vue";
import LoginPage from "../pages/LoginPage.vue";
import TeamCreatePage from "../pages/team/TeamCreatePage.vue";
import TeamMyCreatePage from "../pages/team/TeamMyCreatePage.vue";
import TeamMyJoinPage from "../pages/team/TeamMyJoinPage.vue";
import ChatPage from "../pages/chat/ChatPage.vue";
import AuthorPage from "../pages/AuthorPage.vue";


// 定义路由规则
const routes = [
    {
        path: '/',
        component: Index,
        name: '首页'
    },
    {
        path: '/chat',
        component: ChatPage,
        name: '聊天'
    },
    {
        path: '/team',
        component: Team,
        name: '队伍列表'
    },
    {
        path: '/author',
        component: AuthorPage,
        name: '关于作者'
    },
    {
        path: '/team/my/create',
        component: TeamMyCreatePage,
        name: '我创建的队伍'
    },
    {
        path: '/team/my/join',
        component: TeamMyJoinPage,
        name: '我加入的队伍'
    },
    {
        path: '/team/create',
        component: TeamCreatePage,
        name: '创建队伍'
    },
    {
        path: '/person',
        component: Person,
        name: '个人'
    },
    {
        path: '/person/info',
        component: PersonInfo,
        name: '个人信息'
    },
    {
        path: '/person/edit',
        component: PersonEditPage,
        name: '编辑个人信息'
    },
    {
        path: '/search',
        component: SearchPage,
        name: '搜索伙伴'
    },
    {
        path: '/user/list',
        component: SearchResultPage,
        name: '搜索结果'
    },
    {
        path: '/user/login',
        component: LoginPage,
        name: '登录'
    }
]

// 创建路由对象
const router = VueRouter.createRouter({
    history: VueRouter.createWebHistory(),
    routes
});

// 导出路由对象
export default router;